import request from '@/utils/request'

// 查询退住办理列表
export function listCheckOut(query) {
  return request({
    url: '/nursing/checkOut/list',
    method: 'get',
    params: query
  })
}

// 查询退住办理详细
export function getCheckOut(id) {
  return request({
    url: '/nursing/checkOut/' + id,
    method: 'get'
  })
}

// 新增退住办理
export function addCheckOut(data) {
  return request({
    url: '/nursing/checkOut',
    method: 'post',
    data: data
  })
}

// 修改退住办理
export function updateCheckOut(data) {
  return request({
    url: '/nursing/checkOut',
    method: 'put',
    data: data
  })
}

// 删除退住办理
export function delCheckOut(id) {
  return request({
    url: '/nursing/checkOut/' + id,
    method: 'delete'
  })
}

// 申请退住
export function applyCheckOut(data) {
  return request({
    url: '/nursing/checkOut/apply',
    method: 'post',
    data: data
  })
}

// 获取退住详细信息
export function getCheckOutInfo(id) {
  return request({
    url: '/nursing/checkOut/detail/' + id,
    method: 'get'
  })
}

// 审批退住申请
export function approveCheckOut(data) {
  return request({
    url: '/nursing/checkOut/approve',
    method: 'post',
    params: data
  })
}

// 完成退住
export function completeCheckOut(id) {
  return request({
    url: '/nursing/checkOut/complete/' + id,
    method: 'post'
  })
}

// 撤销退住申请
export function revokeCheckOut(id) {
  return request({
    url: '/nursing/checkOut/revoke/' + id,
    method: 'delete'
  })
}

// 级联删除退住和入住数据
export function deleteCheckOutAndCheckIn(checkOutId, checkInId) {
  return request({
    url: '/nursing/checkOut/deleteWithCheckIn/' + checkOutId + '/' + checkInId,
    method: 'delete'
  })
} 